import request from '@/utils/request'

//展示菜单列表
export function routerList(data) {
	return request({
		url: '/sys/menu/',
		method: 'get',
	})
}
// 查找菜单根据id
export function routerGet(data) {
	return request({
		url: '/sys/menu/' + data.id,
		method: 'get',
	})
}
//根据roleId查询menu
export function getRoleMenu(data) {
	return request({
		url: '/sys/menu/tree/' + data.roleId,
		method: 'get',
	})
}
// 添加路由
export function addRouter(data) {
	return request({
		url: '/sys/menu',
		method: 'post',
		data
	})
}
// 编辑路由
export function updateRouter(data) {
	return request({
		url: '/sys/menu',
		method: 'put',
		data
	})
}
// 删除路由
export function deleteRouter(data) {
	return request({
		url: '/sys/menu/' + data.mId,
		method: 'delete',
	})
}